package com.hanoi.wiki.dao;

import java.util.List;

import com.hanoi.wiki.exception.DataAccessException;

/**
 * @param <T>
 * @param <PK>
 */
public interface GenericDAO<T,PK> {
	/**
	 * get Object from database by id
	 * 
	 * @param id
	 * @return
	 * @throws DataAccessException
	 */
	public T get(PK id) throws DataAccessException;
	
	/**
	 * get list object from database by model
	 * 
	 * @param model
	 * @return
	 * @throws DataAccessException
	 */
	public List<T> getList(T model) throws DataAccessException;
	
	/**
	 * update object to database
	 * 
	 * @param model
	 * @throws DataAccessException
	 */
	public void update(T model) throws DataAccessException;
	
	
	/**
	 * save object to database
	 * 
	 * @param model
	 * @throws DataAccessException
	 */
	public void save(T model) throws DataAccessException;
	
	/**
	 * remove object out of database
	 * 
	 * @param id
	 * @throws DataAccessException
	 */
	public void remove(PK id) throws DataAccessException;
}
